05. What Are Variables?
What Are Variables?
Project Assets
- Sun animator controller: Assets > UdacityVR > Art > Animations > Sun > Sun.controller
Video Addendum
At 0:00 minutes into the video
When the instructor shows the RotateLight script:
- The instructor has modified the code from the previous video.
- For your script to better match up with the rest of the video, we recommend that you update your script with the code provided in the Code Used in Video section below.
Code Used in Video
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RotateLight : MonoBehaviour {
public GameObject directionalLight;
float startTime = 0f;
// Update is called once per frame
void Update () {
Quaternion startRotation = Quaternion.Euler (50f, 30f, 0f);
Quaternion endRotation = startRotation * Quaternion.Euler (0f, 180f, 0f);
directionalLight.transform.rotation = Quaternion.Slerp (startRotation, endRotation, startTime / 10f);
startTime += Time.deltaTime;
}
}